import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:amap_location/amap_location.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

/**
 * 引入工程中的文件
 */
import 'package:atten_sys/activities/login.dart';


void main() {
  //设置高德地图的key
  AMapLocationClient.setApiKey('f98254ca321e1c3fd4d376402511e285');

  runApp(new MyApp());
  if (defaultTargetPlatform == TargetPlatform.android) {
// 以下两行 设置android状态栏为透明的沉浸。写在组件渲染之后，是为了在渲染后进行set赋值，覆盖状态栏，写在渲染之前MaterialApp组件会覆盖掉这个值。
    SystemUiOverlayStyle systemUiOverlayStyle = SystemUiOverlayStyle(statusBarColor: Colors.transparent);
    SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
  }
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      localizationsDelegates: [
        GlobalWidgetsLocalizations.delegate,
        GlobalMaterialLocalizations.delegate
      ],
      supportedLocales: [
        const Locale('en', 'US'),
        const Locale('zh', 'CH'),
      ],
      title: '人事考勤APP',
      home: LoginWidget(),
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
    );
  }
}
